﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Ashwani.Cryptography.Signature
{
    public interface ISignatureProvider
    {
        /// <summary>
        /// creates the signature. The Validation Key will be provided by ISignatureProvider
        /// </summary>
        /// <param name="plaintext"></param>
        /// <returns>signature bytes</returns>
        byte[] CreateSignature(byte[] plaintext);
        
        /// <summary>
        /// compares the signatures. The Validation Key will be provided by ISignatureProvider
        /// </summary>
        /// <param name="plaintext"></param>
        /// <param name="hashedtext"></param>
        /// <returns>returns true if matched</returns>
        bool CompareSignature(byte[] plaintext, byte[] hashedtext);

        /// <summary>
        /// creates signature with the specific validtion key.
        /// </summary>
        /// <param name="plaintext"></param>
        /// <param name="validationKey"></param>
        /// <returns></returns>
        byte[] CreateSignature(byte[] plaintext, byte[] validationKey);

        /// <summary>
        /// compares the signature
        /// </summary>
        /// <param name="plaintext"></param>
        /// <param name="hashedtext"></param>
        /// <param name="validationKey"></param>
        /// <returns>true if matched</returns>
        bool CompareSignature(byte[] plaintext, byte[] hashedtext, byte[] validationKey);
    }
}
